#!/usr/bin/env python3
# -*- coding: utf-8 -*-

"""
# 输出序列,条件满足时,停止循环.
count = 0
while count < 5:
    print(count)
    count += 1


# 死循环
import time 

i = 1
while True:
    print(i)
    i += 1
    time.sleep(0.5)
"""


# 满足条件跳出当前循环
'''
for i in range(1,6):
    if i == 3:
        continue 
    else:
        print(i)
'''

'''
count = 0
while count < 5:
    count += 1
    if count == 3:
        continue 
    else:
        print(count)
'''

# 满足条件终止循环
'''
for i in range(1,6):
    if i == 3:
        break 
    else:
        print(i)
'''

# 输出错误次数超过3次退出
count = 0
while 1:
    if count < 3:
        name = input("input your name:")
        if len(name) == 0:
            print("input not be empty")
            count += 1
            continue 
        elif name == "yuan":
            print("ok")
            break 
        else:
            print( "input name error,please again input" )
            count += 1
    else:
        print("over timeout,exit")
        break
            



